<html>
	<head>
		<meta content="text/html; charset=utf-8" http-equiv="content-Type" />
		<title>test</title>
		
		<script type="text/javascript" src="js/mootools-1.2.2-core-nc.js"></script>
	</head>
	<body>
		<script type="text/javascript">
			var foo = function() {
				var div = new Element('div', {
					id: 'test'
				});
				
				var click = function() {
					alert(this.id);
				}
				
				div.set('html', '<input type="button" />');
				
				div.addEvent('click', click);
				
				$(document.body).grab(div);
				
				return {}
			}()
			
		</script>
	</body>
</html>